package com.ddwl.gate.mapper;

import com.ddwl.common.dao.mapper.BaseMapper;
import com.ddwl.gate.model.Region;
import com.ddwl.schema.bo.gate.RegionBo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Fu Zhaohui
 */
@Repository
public interface RegionMapper extends BaseMapper<Region, String> {

    List<Region> findByProvinceAndCity(@Param("province") String province,
                                       @Param("city") String city);

    List<Region> findAll();

    List<Region> findByKeyword(String keyword);

    Region findByBo(RegionBo regionBo);

    String findCityId(@Param("provinceName") String provinceName,
                      @Param("cityName") String cityName);

    /**
     * 根据城市名称查询下属区县
     * @param cityName
     * @return
     */
    List<Region> findDistrictByCityName(@Param("cityName") String cityName);
}
